﻿using System;
using System.Threading;
using System.Text;

class Program {

    static void Go(StringBuilder result, String name) {
        for (int i=0; i < 100; i++) {
            //lock (result) {
                result.AppendFormat(" {0}: {1}\n", name, i);
                Console.Write(" {0}: {1}\n", name, i);
            //}
        }
    }

    static void Main() {
        StringBuilder result = new StringBuilder();
        Thread t1 = new Thread(() => Go(result, "One "));
        Thread t2 = new Thread(() => Go(result, "Two "));
        t1.Start();
        t2.Start();
        t1.Join();
        t2.Join();
        Console.ReadKey();
    }
}